package com.d2rv.offscreen;

import com.d2rv.guide.GoalManager;
import com.d2rv.model.CityModelManager;
import com.d2rv.skybox.SkyboxManager;
import com.d2rv.user.UserManager;
import processing.core.PApplet;

/**
 * This class is the manager of the anaglyphe offscreen.
 *
 * @author Darrieutort A., Dupouy A., Rossignol L., Van Poucke A.
 */
public class AnaglypheManager {

    private OffScreenUserAnaglyphe offscreenuseranaglyphe;

    /**
     * Default constructor.
     * 
     * 
     * @param parent the current application
     * @param usermanager the manager of the user
     * @param citymodelmanager the manager of the city model
     * @param skyboxmanager the manager of the skybox
     * @param goalmanager the manager of the goal
     */
    public AnaglypheManager(PApplet parent, UserManager usermanager, CityModelManager citymodelmanager, SkyboxManager skyboxmanager, GoalManager goalmanager) {
        this.offscreenuseranaglyphe = new OffScreenUserAnaglyphe(parent, parent.width / 2, parent.height,
                usermanager, citymodelmanager, skyboxmanager, goalmanager);
    }

    /**
     * Calls the draw method of the offscreen user anaglyphe
     */
    public void draw() {
        this.offscreenuseranaglyphe.draw();
    }

    /**
     * Calls the show method the offscreen Anaglyphe Manager
     * @param parent the current application
     * @param x the x coordinate of the left corner of the offscreen
     * @param y the y coordinate of the left corner of the offscreen
     */
    public void show(PApplet parent, int x, int y) {
        this.offscreenuseranaglyphe.show(parent, x, y);
    }
    
    /**
     * Returns the offscreen user anaglyphe
     * @return the offscreen user anaglyphe
     */
    public OffScreenUserAnaglyphe offscreenuseranaglyphe() {
        return this.offscreenuseranaglyphe;
    } 
}